import { mapGetters } from 'vuex'

export const playinglistmixin = {
  activated() {
    this.hangdlePlayList(this.playList)
  },
  mounted() {
    this.hangdlePlayList(this.playList)
  },
  watch: {
    playList(newVal) {
      this.hangdlePlayList(newVal)
    }
  },
  computed: {
    ...mapGetters([
      'playList'
    ])
  },
  methods: {
    hangdlePlayList() {
      throw new Error('...必须在组件中定义hangdlePlayList方法')
    }
  }
}